/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package fiad.gui.events;

import fiad.database.jpa.MyManager;
import fiad.gui.MainFrame;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;

/**
 *
 * @author MJ
 */
public class MainFrameListener extends WindowAdapter implements ActionListener{

    MainFrame mf;
    
    public MainFrameListener(MainFrame mf){
        this.mf = mf;
    }
    
    
    
    public void actionPerformed(ActionEvent e) {

        if(e.getActionCommand().startsWith("CARDS_")){
            mf.showPanel(e.getActionCommand());
        }
    }

    @Override
    public void windowClosing(WindowEvent e) {

        MyManager.releaseEverything();

    }



}
